import fcntl
import select
+import arch
from Test import *
TIMEDOUT = 1
def __getprompt(self, fd):
timeout = 0
bytes = 0
+ buffer = ""
while timeout < 180:
# eat anything while total bytes less than limit else raise RUNAWAY
while (not self.limit) or (bytes < self.limit):
if self.debugMe:
sys.stdout.write(foo)
bytes += 1
+ buffer += foo
except Exception, exn:
raise ConsoleError(str(exn))
else:
else:
raise ConsoleError("Console run-away (exceeded %i bytes)"
% self.limit, RUNAWAY)
+ # Check to see if the buffer contains anything interetsing
+ arch.checkBuffer(buffer)
# press enter
os.write(self.consoleFd, "\n")
# look for prompt
import config
import commands
+from Test import *
+
BLOCK_ROOT_DEV = "hda"
# This isn't truly platform related but it makes the code tidier
return rdpath
# Begin: Intel ia32 and ia64 as well as AMD 32-bit and 64-bit processors
+def ia_checkBuffer(buffer):
+ return
+
def ia_minSafeMem():
return 32
# End : Intel ia32 and ia64 as well as AMD 32-bit and 64-bit processors
# Begin: PowerPC
+def ppc_checkBuffer(buffer):
+ checks = [
+ {"pattern" : re.compile("^\d+:mon>\s*$", re.MULTILINE),
+ "message" : "domain trapped into XMON"},
+ ]
+
+ for i in range(0, len(checks)):
+ check=checks[i]
+ if check.get('pattern').search(buffer):
+ FAIL(check.get('message'))
+
+ return
+
def ppc_minSafeMem():
return 64
if _arch == "x86" or _arch == "ia64":
minSafeMem = ia_minSafeMem
getDefaultKernel = ia_getDefaultKernel
+ checkBuffer = ia_checkBuffer
if config.ENABLE_HVM_SUPPORT:
configDefaults = ia_HVMDefaults
else:
elif _arch == "powerpc":
minSafeMem = ppc_minSafeMem
getDefaultKernel = ppc_getDefaultKernel
+ checkBuffer = ppc_checkBuffer
configDefaults = ppc_ParavirtDefaults
else:
raise ValueError, "Unknown architecture!"